import { NextRequest, NextResponse } from 'next/server'
import { signToken, verifyToken } from '@/util/jwt'
export async function POST(req: NextRequest) {
  const key = process.env.HEADER_TOKEN
  const token = req.headers.get(key as string) as string
  const info = verifyToken(token)
  return NextResponse.json({
    msg: info,
  })
}
export async function GET(requset: NextRequest) {
  const token = signToken({ name: 'zhangsan' })
  console.log('token', token)
  return NextResponse.json({
    msg: token,
  })
}
